package com.yang.base.jpa.entity;

import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;

import jakarta.persistence.*;
import java.time.LocalDateTime;

@Getter
@Setter
@MappedSuperclass
@NoArgsConstructor
public abstract class DeletableEntity extends BaseEntity {

    public static final String DELETED_FALSE_CONDITION = "deleted = false";

    boolean deleted;

    public DeletableEntity(
            boolean deleted, LocalDateTime createdAt, LocalDateTime updatedAt, Integer version) {
        this.deleted = deleted;
        this.createdAt = createdAt;
        this.updatedAt = updatedAt;
        this.version = version;
    }
}
